<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = $show_scroll = $show_dialog = 1;
include $this->admin_tpl('header', 'admin');
?>
<h3 style="padding-left: 20px;padding-top: 10px">
<?php echo $info['real_name']?>——个人信息
<a href="javascript:history.back(-1);" style="font-size:14px;color: #0000FF"><em>返回上一级</em></a>
</h3>
<script type="text/javascript">
window.onload = function(){
	var oInput = document.getElementById("realname");
	oInput.focus();
}


function ages()   
{		
	  var str = $("input[name='talent[birthday]']").val();
      var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);     
      if(r==null)return   false;     
      var   d=   new   Date(r[1],   r[3]-1,   r[4]);     
      if   (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4])   
      {   
            var   Y   =   new   Date().getFullYear();   
            $("input[name='talent[age]']").val(Y-r[1]); 
      }   
      return("输入的日期格式错误！");   
}
</script>
<form method="post" action="?m=talent&c=manage&a=edit&id=<?php echo $info['id']?>&talent_type=5&pc_hash=<?php echo $_SESSION['pc_hash']?>" id="myform">
	<div class="pad-10">
	<div class="col-tab">
	<ul class="tabBut cu-li">
		<li id="tab_info_1" class="on" onclick="SwapTab('info','on','',6,1);"><?php echo L('basic_info', '', 'admin');?></li>
		<li id="tab_info_2" onclick="SwapTab('info','on','',6,2);"><?php echo L('extend_info')?></li>
	</ul>
		<div class="col-tab">
			<div id="div_info_1" class="contentList pad-10">
				<table width="100%" class="table_form ">
					<tbody>
						<tr>
							<th width="200"><?php echo L('judges_realname')?>：</th>
							<td><input name="talent[real_name]" id="realname" class="input-text" type="text" size="40" value="<?php echo $info['real_name']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('judges_enname')?>：</th>
							<td><input name="talent[en_name]" id="enname" class="input-text" type="text" size="40" value="<?php echo $info['en_name']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('judges_nickname')?>：</th>
							<td><input name="talent[nickname]" id="nickname" class="input-text" type="text" size="40" value="<?php echo $info['nickname']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('judges_gender')?>：</th>
							<td><?php echo form::radio(array('1'=>L('boy'),'2'=>L('girl'),'3'=>L('secret')),$info['gender'],'name="talent[gender]"')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('talent_type')?>：</th>
							<td><?php if($info['is_judge'] == '0'){echo '非评委';}elseif($info['is_judge'] == '1'){echo '评委';}?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('people')?>：</th>
							<td><?php echo form::radio(array('1'=>L('zh_people'),'2'=>L('ex_people')),$info['people'],'name="talent[people]"')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('blood_type')?>：</th>
							<td><?php echo form::select(array(
									'A'=>'A型',
									'B'=>'B型',
									'O'=>'O型',
									'AB'=>'AB型',
							),$info['blood_type'],'name="talent[blood_type]"','请选择血型')?>
							</td>
						</tr>
						<tr>
							<th width="200"><?php echo L('label')?>：</th>
							<td><?php echo form::radio(array('1'=>L('women'),'2'=>L('men'),'3'=>L('child')),$info['label'],'name="talent[label]"')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('letter')?>：</th>
							<td><input name="talent[letter]" id="letter" class="input-text" type="text" size="1" value="<?php echo $info['letter']?>"><font color="red">请根据模特的姓氏来输入相应的英文单字母，比如说，有一个模特名叫：张蓝雨。请在该输入框输入Z(大写才可以)。</font></td>
						</tr>
						<!-- <tr>
							<th width="200"><?php echo L('source')?>：</th>
							<td><?php echo form::select($this->talent_source,$info['source'],'name="talent[source]"')?></td>
						</tr> -->
						<tr>
							<th><?php echo L('judges_birthday')?>：</th>
							<td><?php echo form::date('talent[birthday]',$info['birthday'],0,0,true,0,'ages();');?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('judges_age')?>：</th>
							<td><input name="talent[age]" id="age" class="input-text" type="text" size="40" value="<?php echo $info['age']?>" readonly="readonly"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('telephone')?>：</th>
							<td><input name="talent[telephone]" id="telephone" class="input-text" type="text" size="40" value="<?php echo $info['telephone']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('email')?>：</th>
							<td><input name="talent[email]" id="email" class="input-text" type="text" size="40" value="<?php echo $info['email']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('identification')?>：</th>
							<td><input name="talent[identification]" id="identification" class="input-text" type="text" size="40" value="<?php echo $info['identification']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('o_company')?>：</th>
							<?php if(empty($this->company)):?>
							<td><input name="talent[company]" id="company" class="input-text" type="text" size="40" value="<?php echo $info['company']?>"></td>
							<?php else:?>
							<td><?php echo form::select($this->company,$info['company'],'name="talent[company]"','请选择公司')?></td>
							<?php endif;?>
						</tr>
						<tr>
							<th width="200"><?php echo L('height')?>：</th>
							<td><input name="talent[height]" id="height" class="input-text" type="text" size="40" value="<?php echo $info['height']?>"><font color="red">注意：请输入正整数，单位为CM</font></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('weight')?>：</th>
							<td><input name="talent[weight]" id="weight" class="input-text" type="text" size="40" value="<?php echo $info['weight']?>"><font color="red">注意：请输入正整数，单位为KG</font></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('university')?>：</th>
							<td><input name="talent[university]" id="university" class="input-text" type="text" size="40" value="<?php echo $info['university']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('diploma')?>：</th>
							<td><?php echo form::select($this->talent_xl,$info['diploma'],'name="talent[diploma]"','请选择学历')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('province_contest')?>：</th>
							<td><?php echo form::select($this->province,$info['province_contest'],'name="talent[province_contest]" id="province_contest"','请选择赛区省份')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('province_native')?>：</th>
							<td><?php echo form::select($this->province,$info['province_native'],'name="talent[province_native]" id="province_native"','请选择籍贯省份')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('city')?>：</th>
							<td><input name="talent[city]" id="city" class="input-text" type="text" size="40" value="<?php echo $info['city']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('bust')?>：</th>
							<td><input name="talent[bust]" id="bust" class="input-text" type="text" size="40" value="<?php echo $info['bust']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('waist')?>：</th>
							<td><input name="talent[waist]" id="waist" class="input-text" type="text" size="40" value="<?php echo $info['waist']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('hips')?>：</th>
							<td><input name="talent[hips]" id="hips" class="input-text" type="text" size="40" value="<?php echo $info['hips']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('shoe_size')?>：</th>
							<td><input name="talent[shoe_size]" id="shoe_size" class="input-text" type="text" size="40" value="<?php echo $info['shoe_size']?>"></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('address')?>：</th>
							<td><input name="talent[address]" id="address" class="input-text" type="text" size="40" value="<?php echo $info['address']?>"></td>
						</tr>
						<tr>
							<th width="200">城市（官网）：</th>
							<td><?php echo form::select($this->city,$info['new_city'],'name="talent[new_city]"','请选择城市')?><font color="red"> 该字段用于前台根据城市条件搜索模特使用</font></td>
						</tr>
						<tr>
							<th width="200">人才所在洲：</th>
							<td><?php echo form::select($this->continent,$info['continent'],'name="talent[continent]"','请选择')?></td>
						</tr>
						<tr>
							<th width="200">国家：</th>
							<td>
								<select name="talent[nation_cn]">
									<option value="">请选择</option>
									<?php foreach ($this->nation as $v) {?>
									<option value="<?=$v['nation_cn']?>|<?=$v['nation_en']?>" <?php if($v['nation_cn'] == $info['nation_cn']){ echo 'selected';}?>><?=$v['nation_cn']?>/<?=$v['nation_en']?></option>
									<?php }?>
								</select>
							</td>
						</tr>
						<tr>
							<th width="200"><?php echo L('voice_url')?>：</th>
							<td><?php echo form::upfiles('talent[voice_url]', 'voice_url', $info['voice_url'], '', '', 40, '', '', 'mp3','voice_placeholder_name')?></td>
						</tr>
						<tr>
							<th width="200">视频链接：</th>
							<td><?php echo form::upfiles('talent[video_url]', 'video_url', $info['video_url'], '', '', 40, '', '', 'mp4|avi')?></td>
						</tr>
						<tr>
							<th>视频封面图：</th>
							<td><?php echo form::images('talent[video_cover]', 'video_cover', $info['video_cover'], 'moter', '', 40)?></td>
						</tr>
					</tbody>
				</table>
			</div>
			<div id="div_info_2" class="contentList pad-10 hidden">
				<table width="100%" class="table_form ">
					<tr>
							<th><?php echo L('image_square')?>：</th>
							<td><?php echo form::images('talent[image_square]', 'image_square', $info['image_square'], 'judges', '', 40)?><font color="red">为保证显示效果，请上传宽高为500*500的图片</font></td>
						</tr>
						<tr>
							<th><?php echo L('image_circular')?>：</th>
							<td><?php echo form::images('talent[image_circular]', 'image_circular', $info['image_circular'], 'judges', '', 40)?><font color="red">为保证显示效果，请上传宽高为500*500的图片</font></td>
						</tr>
						<tr>
							<th><?php echo L('image_horizontal')?>：</th>
							<td><?php echo form::images('talent[image_horizontal]', 'image_horizontal', $info['image_horizontal'], 'judges', '', 40)?><font color="red">为保证显示效果，请上传宽高为500*340的图片</font></td>
						</tr>
						<tr>
							<th><?php echo L('image_vertical')?>：</th>
							<td><?php echo form::images('talent[image_vertical]', 'image_vertical', $info['image_vertical'], 'judges', '', 40)?><font color="red">为保证显示效果，请上传宽高为500*650的图片</font></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('hobby')?>：</th>
							<td><textarea name="talent[hobby]" id="hobby"><?php echo $info['hobby']?></textarea><?php echo form::editor('hobby','full','','','',1,1,'')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('introduction')?>：</th>
							<td><textarea name="talent[introduction]" id="introduction"><?php echo $info['introduction']?></textarea><?php echo form::editor('introduction','full','','','',1,1,'')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('award')?>：</th>
							<td><textarea name="talent[award]" id="award"><?php echo $info['award']?></textarea><?php echo form::editor('award','full','','','',1,1,'')?></td>
						</tr>
						<tr>
							<th width="200"><?php echo L('autograph')?>：</th>
							<td><textarea name="talent[autograph]" id="autograph"><?php echo $info['autograph']?></textarea><?php echo form::editor('autograph','full','','','','',1,'')?></td>
						</tr>
						<input type="hidden" name="talent[menuid]" value="<?php echo $_GET['menuid']?>">
				</table>
			</div>
			<div class="bk15"></div>
			<input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button">
		</div>
	</div>
</div>
</form>
</body>
</html>
<script type="text/javascript">

function SwapTab(name,cls_show,cls_hide,cnt,cur){
	for(i=1;i<=cnt;i++){
		if(i==cur){
			 $('#div_'+name+'_'+i).show();
			 $('#tab_'+name+'_'+i).attr('class',cls_show);
		}else{
			 $('#div_'+name+'_'+i).hide();
			 $('#tab_'+name+'_'+i).attr('class',cls_hide);
		}
	}
}
//校验手机号
function isTel(tel){
	if(!(/^1(3[0-9]|5[012356789]|8[0-9]|4[7]|7[678])\d{8}$/.test(tel))) return "请输入正确的手机号";
	return true;
}

//校验真实姓名
function isRealname(realname){
	if(!(/^[\u4e00-\u9fa5]{2,4}$/i.test(realname))) return "请填写真实姓名";
	return true;
}

//校验邮箱
function isEmail(email){
	if(!(/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/.test(email))) return "请输入正确的邮箱";
	return true;
}

//校验大写字母
function isWordbig(word){
	if(!(/^[A-Z]+$/.test(word))) return "请输入正确的姓氏首字母";
	return true;
}
$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
	$('#realname').formValidator({
		autotip:true,
		onshow:"<?php echo L('please_input_judges_realname')?>",
		onfocus:"<?php echo L('please_input_judges_realname')?>",
		oncorrect:"<?php echo L('right')?>"}).inputValidator({
			min:1,onerror:"<?php echo L('please_input_judges_realname')?>"}).functionValidator({fun:isRealname}).ajaxValidator({
				type:"GET",
				url:"",
				data:"m=talent&c=manage&a=auto_letter",
				datatype:"html",
				cache:false,
				async:"true",
				success:function(data){
					if(data !="" && data !="undefined"){
						$("input[name='talent[letter]']").val(data);
						return true;
						}
					}
				});
	$('#email').formValidator({
    	autotip:false,
    	onshow:'<?php echo L('please_input_email')?>',
        empty:true}).functionValidator({fun:isEmail});
    $('#identification').formValidator({
    	autotip:false,
    	onshow:'<?php echo L('please_input_identification')?>',
        empty:true}).functionValidator({fun:isCardID});
    $('#letter').formValidator({
		autotip:true,
		onshow:"<?php echo L('please_input_moter_letter')?>",
		onfocus:"<?php echo L('please_input_moter_letter')?>",
		oncorrect:"<?php echo L('right')?>"}).inputValidator({
			min:1,onerror:"<?php echo L('please_input_moter_letter')?>"
		}).functionValidator({fun:isWordbig});
    $('#height').formValidator({
    	autotip:false,
    	onshow:'<?php echo L('please_input_integer')?>',
    	onfocus: '<?php echo L('please_input_height_true')?>',
    	oncorrect: '<?php echo L('true')?>',
        empty:true}).regexValidator({regexp: regexEnum.intege1,onerror: '<?php echo L('height_false')?>'});
    $('#weight').formValidator({
    	autotip:false,
    	onshow:'<?php echo L('please_input_integer')?>',
    	onfocus: '<?php echo L('please_input_weight_true')?>',
    	oncorrect: '<?php echo L('true')?>',
        empty:true}).regexValidator({regexp: regexEnum.intege1,onerror: '<?php echo L('weight_false')?>'});
});

function preview(name,filepath) {
		window.top.art.dialog({title:'<?php echo L('preview')?>',fixed:true, content:'<img src="'+filepath+'" onload="$(this).LoadImage(true, 500, 500,\'<?php echo IMG_PATH?>nopic.gif\');"/>'});	
}
</script>